package com.weight.system.fix.service.impl;

import com.weight.system.fix.PO.FixInfo;
import com.weight.system.fix.service.FixInfoService;
import com.weight.system.fix.DAO.FixInfoMapper;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
import com.weight.common.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;

/**
 * 设备维修记录表
 */
@Service
@Transactional
@Slf4j
public class FixInfoServiceImpl implements FixInfoService {

	@Autowired
	private FixInfoMapper fixInfoMapper;


	/**
	 * 查询设备维修记录信息--条件查询
	 * @param map
	 * @return
	 */
	@Override
	public List<FixInfo> findFixInfoByT(Map map){
		return fixInfoMapper.findFixInfoByT(map);
	}

	/**
	 * 查询设备维修记录信息--条件，分页查询
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	@Override
	public List<FixInfo> findFixInfoByPage(int currentPage,int pageSize,Map map){
		PageHelper.startPage(currentPage, pageSize);
		List<FixInfo> fixInfoList = fixInfoMapper.findFixInfoByT(map);
		return fixInfoList;
	}

	/**
	 * 查询设备维修记录信息--查询全部
	 * @return
	 */
	@Override
	public List<FixInfo> findAll(){
		return fixInfoMapper.findAll();
	}

	/**
	 * ID查询设备维修记录信息
	 * @param map
	 * @return
	 */
	@Override
	public FixInfo findByFixInfoId(Map map){
		FixInfo fixInfo=fixInfoMapper.findByFixInfoId(map);
		CommonUtils.validateExistObj(fixInfo,map);
		return fixInfo;
	}

	/**
	 * ID查询设备维修记录信息-批量
	 * @param fixInfoIdList
	 * @return
	 */
	@Override
	public List findByFixInfoIdList(List fixInfoIdList){
		List idList = fixInfoMapper.findByFixInfoIdList(fixInfoIdList);
		CommonUtils.validateExistList(idList,fixInfoIdList);
		return idList;
	}

	/**
	 * 添加设备维修记录
	 * @param fixInfo
	 */
	@Override
	public void insertFixInfo(FixInfo fixInfo){
		fixInfoMapper.insertFixInfo(fixInfo);
	}

	/**
	 * 批量添加设备维修记录
	 * @param fixInfoList
	 */
	@Override
	public void insertFixInfoBatch(List<FixInfo> fixInfoList){
		fixInfoMapper.insertFixInfoBatch(fixInfoList);
	}

	/**
	 * 修改设备维修记录
	 * @param fixInfo
	 */
	@Override
	public void updateFixInfo(FixInfo fixInfo){
		fixInfoMapper.updateFixInfo(fixInfo);
	}

	/**
	 * 修改设备维修记录
	 * @param fixInfo
	 */
	@Override
	public void updateFixInfoLimt(FixInfo fixInfo){
		fixInfoMapper.updateFixInfoLimt(fixInfo);
	}

	/**
	 * 物理删除设备维修记录
	 * @param map
	 */
	@Override
	public void deleteByFixInfoId(Map map){
		fixInfoMapper.deleteByFixInfoId(map);
	}

	/**
	 * 批量物理删除设备维修记录
	 * @param fixInfoIdList
	 */
	@Override
	public void deleteByFixInfoIdBatch(List fixInfoIdList){
		fixInfoMapper.deleteByFixInfoIdBatch(fixInfoIdList);
	}

	/**
	 * 状态删除设备维修记录
	 * @param map
	 */
	@Override
	public void upDelByFixInfoId(Map map){
		fixInfoMapper.upDelByFixInfoId(map);
	}

	/**
	 * 批量状态删除设备维修记录
	 * @param fixInfoList
	 */
	@Override
	public void upDelByFixInfoIdBatch(Map<String, Object> map){
		fixInfoMapper.upDelByFixInfoIdBatch(map);
	}

}